package code.xiaohh.cloudalibaba.common.feigns;

import code.xiaohh.cloudalibaba.common.constant.ServiceNameConstant;
import code.xiaohh.cloudalibaba.common.entities.payment.PaymentEntity;
import code.xiaohh.cloudalibaba.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 支付服务远程调用的接口类
 * </p>
 *
 * @author XiaoHH
 * @version 1.0
 * @date 2021-04-09 星期五 23:05:34
 * @file PaymentFeignClient.java
 */
@Component
@FeignClient(name = ServiceNameConstant.PAYMENT_SERVICE)
public interface PaymentFeignClient {

    /**
     * 列表
     */
    @GetMapping("/payment/payment/list")
    R list(@RequestParam Map<String, Object> params);

    /**
     * 信息
     */
    @GetMapping("/payment/payment/info/{paymentId}")
    R info(@PathVariable("paymentId") Long paymentId);

    /**
     * 保存
     */
    @PostMapping("/payment/payment/save")
    R save(@RequestBody PaymentEntity payment);

    /**
     * 修改
     */
    @PutMapping("/payment/payment/update")
    R update(@RequestBody PaymentEntity payment);

    /**
     * 删除
     */
    @DeleteMapping("/payment/payment/delete")
    R delete(@RequestBody Long[] paymentIds);

}
